# Contributor: Bart Ribbers <bribbers@disroot.org>
# Maintainer: team/kde <bribbers@disroot.org>

# The group tag is just to easily find this APKBUILD by some scripts for automation
# group=kde-other
pkgname=phonon-backend-vlc
pkgver=0.12.0
pkgrel=0
pkgdesc="Phonon VLC backend"
url="https://userbase.kde.org/Phonon"
# armhf blocked by extra-cmake-modules
# s390x blocked by vlc
arch="all !armhf !s390x"
license="LGPL-2.1-or-later"
makedepends="
	extra-cmake-modules
	phonon-dev
	qt5-qtbase-dev
	qt5-qttools-dev
	qt6-qtbase-dev
	qt6-qttools-dev
	samurai
	vlc-dev
	"
subpackages="$pkgname-lang $pkgname-qt5 $pkgname-qt6"
_repo_url="https://invent.kde.org/libraries/phonon-vlc.git"
source="https://download.kde.org/stable/phonon/phonon-backend-vlc/$pkgver/phonon-backend-vlc-$pkgver.tar.xz"
options="!check" # no tests

build() {
	cmake -B build -G Ninja \
		-DCMAKE_BUILD_TYPE=RelWithDebInfo \
		-DCMAKE_INSTALL_PREFIX=/usr \
		-DCMAKE_INSTALL_LIBDIR=lib
	cmake --build build
}

package() {
	DESTDIR="$pkgdir" cmake --install build
}

qt5() {
	amove usr/lib/qt5/plugins/phonon4qt5_backend
}

qt6() {
	amove usr/lib/qt5/plugins/phonon4qt6_backend
}

sha512sums="
78f5ead829d5025c7cb9e01b33819514d795651d1d932c03bd8cc2ad5d427e5aaaeeb6016820d5a7bb9907f6df1142a0fbc097830d7c63b01f77d2167a0c9264  phonon-backend-vlc-0.12.0.tar.xz
"
